import request from '@/utils/request'

export default {
  //生成订单
  createOrder(courseId) {
    return request({
      url: `/eduorder/order/createOrder/${courseId}`,
      method: 'get'
    })
  },
  //根据订单id获取订单信息
  getOrderInfo(id) {
    return request({
      url: `/eduorder/order/getOrderInfo/${id}`,
      method: 'get'
    })
  },
  //生成二维码的方法
  createNative(orderNo) {
    return request({
      url: `/eduorder/payLog/createNative/${orderNo}`,
      method: 'get'
    })
  },

  //查询订单状态
  queryPayStatus(orderNo) {
    return request({
      url: `/eduorder/payLog/queryPayStatus/${orderNo}`,
      method: 'get'
    })
  },
  // //根据课程id和用户id查询是否购买
  // //查询订单状态
  // isBuyCourse(courseId,memberId){
  //   return request({
  //     url: `/eduorder/order/isBuyCourse/${courseId}/${memberId}`,
  //     method: 'get'
  //   })
  // }
  getOrderByUserId() {
    return request({
      url: `/eduorder/order/getOrderByUserId`,
      method: 'get'
    })
  },

}
